﻿ #region Disclaimer/Info
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 //
 //   File:		ICommentRepository.cs
 //   Website:		http://dexterblogengine.com/
 //   Authors:		http://dexterblogengine.com/About.ashx
 //   Rev:		1
 //   Created:		19/01/2011
 //   Last edit:		19/01/2011
 //   License:		GNU Library General Public License (LGPL)
 //   File:            ICommentRepository.cs
 //   For updated news and information please visit http://dexterblogengine.com/
 //   Dexter is hosted to Codeplex at http://dexterblogengine.codeplex.com
 //   For any question contact info@dexterblogengine.com
 //
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 #endregion

using System;
using System.Collections.Generic;
using Dexter.Domain.Model;
using Dexter.Domain.Results;

namespace Dexter.Repository {

	/// <summary>
	/// 	Rapresents a repository of <see cref="Comment"/>.
	/// </summary>
	public interface ICommentRepository : IRepository <Comment> {

		///<summary>
		///	Retrieve a set of approved comments with the basic properties of Item loaded.
		///</summary>
		///<param name = "pageIndex">Index of the page (0 based).</param>
		///<param name = "pageSize">The number of items to retrieve.</param>
		///<returns>An concrete implementation of <see cref="IPagedResult{T}"/>. The result will never be null.</returns>
		///<exception cref="ArgumentOutOfRangeException"> If <paramref name="pageIndex"/> is lesser than 0.</exception>
		///<exception cref="ArgumentOutOfRangeException"> If <paramref name="pageSize"/> is lesser than 1.</exception>
		IPagedResult <Comment> GetApprovedWithBasicItemProperties ( int pageIndex , int pageSize );

		///<summary>
		///	Retrieve a set of approved comments with the basic properties of Item loaded.
		///</summary>
		///<param name = "pageIndex">Index of the page (0 based).</param>
		///<param name = "pageSize">The number of items to retrieve.</param>
		/// <param name = "enableTracking">if set to <c>true</c> the tracking system of the return object will be enable.</param>
		///<returns>An concrete implementation of <see cref="IPagedResult{T}"/>. The result will never be null.</returns>
		///<exception cref="ArgumentOutOfRangeException"> If <paramref name="pageIndex"/> is lesser than 0.</exception>
		///<exception cref="ArgumentOutOfRangeException"> If <paramref name="pageSize"/> is lesser than 1.</exception>
		IPagedResult <Comment> GetApprovedWithBasicItemProperties ( int pageIndex , int pageSize , bool enableTracking );

		///<summary>
		///	Retrieve a set of unapproved comments with the basic properties of Item loaded.
		///</summary>
		///<param name = "pageIndex">Index of the page (0 based).</param>
		///<param name = "pageSize">The number of items to retrieve.</param>
		///<returns>An concrete implementation of <see cref="IPagedResult{T}"/>. The result will never be null.</returns>
		///<exception cref="ArgumentOutOfRangeException"> If <paramref name="pageIndex"/> is lesser than 0.</exception>
		///<exception cref="ArgumentOutOfRangeException"> If <paramref name="pageSize"/> is lesser than 1.</exception>
		IPagedResult <Comment> GetUnapprovedWithBasicItemProperties ( int pageIndex , int pageSize );

		///<summary>
		///	Retrieve a set of unapproved comments with the basic properties of Item loaded.
		///</summary>
		///<param name = "pageIndex">Index of the page (0 based).</param>
		///<param name = "pageSize">The number of items to retrieve.</param>
		/// <param name = "enableTracking">if set to <c>true</c> the tracking system of the return object will be enable.</param>
		///<returns>An concrete implementation of <see cref="IPagedResult{T}"/>. The result will never be null.</returns>
		///<exception cref="ArgumentOutOfRangeException"> If <paramref name="pageIndex"/> is lesser than 0.</exception>
		///<exception cref="ArgumentOutOfRangeException"> If <paramref name="pageSize"/> is lesser than 1.</exception>
		IPagedResult <Comment> GetUnapprovedWithBasicItemProperties ( int pageIndex , int pageSize , bool enableTracking );

		///<summary>
		///	Retrieve the latest approved comments with the basic properties of Item loaded.
		///</summary>
		///<param name = "number">The number of items to retrieve.</param>
		///<returns>
		///	An instance of comment.
		///	The return object could be null if there arent items unapproved into the repository.
		///</returns>
		///<exception cref="ArgumentOutOfRangeException"> If <paramref name="number"/> is lesser than 0.</exception>
		IEnumerable <Comment> GetRecentCommentWithBasicItemProperties ( int number );

		///<summary>
		///	Retrieve the latest approved comments with the basic properties of Item loaded.
		///</summary>
		///<param name = "number">The number of items to retrieve.</param>
		/// <param name = "enableTracking">if set to <c>true</c> the tracking system of the return object will be enable.</param>
		///<returns>
		///	An instance of comment.
		///	The return object could be null if there arent items unapproved into the repository.
		///</returns>
		///<exception cref="ArgumentOutOfRangeException"> If <paramref name="number"/> is lesser than 0.</exception>
		IEnumerable <Comment> GetRecentCommentWithBasicItemProperties ( int number , bool enableTracking );

		/// <summary>
		/// 	Retrieve the latest approved comments with the basic properties of Item loaded.
		/// </summary>
		/// <param name = "key">The key of the comment.</param>
		/// <returns>
		/// 	An instance of comment.
		/// 	The return object could be null if there isn't a comment with the specified key into the repository.
		/// </returns>
		///<exception cref="ArgumentOutOfRangeException"> If <paramref name="key"/> is lesser than 0.</exception>
		Comment GetByKeyWithBasicItemProperties ( int key );

		/// <summary>
		/// 	Retrieve the latest approved comments with the basic properties of Item loaded.
		/// </summary>
		/// <param name = "key">The key of the comment.</param>
		/// <param name = "enableTracking">if set to <c>true</c> the tracking system of the return object will be enable.</param>
		/// <returns>
		/// 	An instance of comment.
		/// 	The return object could be null if there isn't a comment with the specified key into the repository.
		/// </returns>
		///<exception cref="ArgumentOutOfRangeException"> If <paramref name="key"/> is lesser than 0.</exception>
		Comment GetByKeyWithBasicItemProperties ( int key , bool enableTracking );

		/// <summary>
		/// Deletes all unapproved comment from the repository.
		/// </summary>
		/// <returns>The number of comments deleted.</returns>
		int DeleteAllUnapprovedComment ( );

		/// <summary>
		/// 	Saves the specified item into the repository.
		/// </summary>
		/// <param name = "item">The item to save.</param>
		///<exception cref="ArgumentNullException"> If <paramref name="item"/> is <c>null</c>.</exception>
		void Save ( Comment item );

		/// <summary>
		/// 	Updates the specified item into the repository.
		/// </summary>
		/// <param name = "item">The item to update.</param>
		///<exception cref="ArgumentNullException"> If <paramref name="item"/> is <c>null</c>.</exception>
		void Update ( Comment item );
	}
}
